package com.colaps.gifts;




import java.util.ArrayList;

import com.colaps.gifts.R;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;

public class Gift extends Activity{
	
	private EditText regalonombre;
	private EditText regalomarca;
	private EditText regalomodelo;
	private EditText regalotienda;
	private EditText regalodetalles;
	
	public static final String EXTRA_GIFT = "GIFT";
	
	
	@Override
	public void onCreate(Bundle savedInstanceState){
		super.onCreate(savedInstanceState);
		setContentView(R.layout.regalo);		
	}
	
	@Override
	public void onBackPressed() {
       	finish();
    }
	
	@Override
	public void onStart(){
		super.onStart();
	}
	@Override
	public void onResume(){
		super.onResume();
	}
	
	public void guardarGift(View view){
		
		regalonombre = (EditText)findViewById(R.id.regalonombre01);
		regalomarca = (EditText)findViewById(R.id.regalomarca02);
		regalomodelo = (EditText)findViewById(R.id.regalomodelo02);
		regalotienda = (EditText)findViewById(R.id.regalotienda02);
		regalodetalles = (EditText)findViewById(R.id.regalodetalles02);
		
		ArrayList<String> regalo = new ArrayList<String>();
		   	regalo.add(regalonombre.getText().toString());
	    	regalo.add(regalomarca.getText().toString());
	    	regalo.add(regalomodelo.getText().toString());
	    	regalo.add(regalotienda.getText().toString());
	    	regalo.add(regalodetalles.getText().toString());
	    
	    Intent intentMiLista = new Intent();
		intentMiLista.putExtra(EXTRA_GIFT, regalo);
		setResult(Gifts.ADD_REGALO,intentMiLista);
		finish();
	}

	public void onClick(View v) {
		// TODO Auto-generated method stub		
	}
	
	
}
